package com.knife.news.manage.action;

import java.util.ArrayList;
import java.util.List;

import com.knife.news.logic.impl.FlowNodeServiceImpl;
import com.knife.news.logic.impl.FlowServiceImpl;
import com.knife.news.logic.impl.NewsServiceImpl;
import com.knife.news.logic.impl.TypeServiceImpl;
import com.knife.news.logic.impl.UserServiceImpl;
import com.knife.news.object.Comment;
import com.knife.news.object.News;
import com.knife.news.object.Type;
import com.knife.web.Module;
import com.knife.web.Page;
import com.knife.web.WebForm;

public class TaskManageAction extends ManageAction {

	private NewsServiceImpl newsDao = NewsServiceImpl.getInstance();
	private UserServiceImpl userDao = UserServiceImpl.getInstance();
	private TypeServiceImpl typeDao = TypeServiceImpl.getInstance();
	private FlowNodeServiceImpl flownodeDao = FlowNodeServiceImpl.getInstance();
	private FlowServiceImpl flowDao = FlowServiceImpl.getInstance();
	
	
	public Page doInit(WebForm form, Module module) {
		return module.findPage("index");
	}
	
	public Page doList(WebForm form, Module module) {
		if(user!=null){
			if(user.getPopedom()<2){
				List<Type> typell =typeDao.getAllRightTypes(user.getId());
				
			}
		}
		return module.findPage("list");
//		List<News> unewsList = newsDao.getComment();
//		int rows = commList.size();// 分页开始
//		int pageSize = 15;
//		int currentPage = 1;
//		int frontPage = 0;
//		int nextPage = 2;
//		List<Comment> firstComm = new ArrayList<Comment>();
//		int totalPage = (int) Math.ceil((float) (rows) / (float) (pageSize));
//		firstComm = commDAO.getCommBySql("id!='' order by k_date desc", null,
//				0, pageSize);
//		form.addResult("rows", rows);
//		form.addResult("pageSize", pageSize);
//		form.addResult("frontPage", frontPage);
//		form.addResult("currentPage", currentPage);
//		form.addResult("nextPage", nextPage);
//		form.addResult("totalPage", totalPage);
//		form.addResult("commList", firstComm);
//		return module.findPage("list");
	}
}
